﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Df.Common.Forms;

namespace Df.Web.Model
{   
    public class DfFormViewModel : BaseViewModel
    {

        public DfFormViewModel()
        {
        }

        public static DfFormViewModel FromDfForm(DForm dfform)
        {
            return Df.Framework.Helper.AutoMapper.Map<DForm, DfFormViewModel>(dfform);
        }

        public DForm ToDfForm()
        {
            return Df.Framework.Helper.AutoMapper.Map<DfFormViewModel, DForm>(this);
        }

        public List<DfBaseElement> Elements { get; set; }

        public string Name
        {
            get { return string.Format("DForm{0}", Id); }
        }

        public int Id { get; set; }

        public string Title { get; set; }

        public string HelpText { get; set; }

        public bool ReadOnly { get; set; }
    }
}
